home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Miscellany / Patch.cp < prev    next >
Text File  |  2000-06-23  |  503b  |  25 lines

  1. // Patch.cp
  2.  
  3. #ifndef Patch_h
  4. #include "Patch.h"
  5. #endif
  6.  
  7. PatchBase::PatchBase( TrapType theType,
  8.                              int16 theTrapNumber,
  9.                              int32 theProcInfo,
  10.                              const RoutineDescriptor *patch )
  11.   : old( NGetTrapAddress( theTrapNumber, theType ) ),
  12.      procInfo( theProcInfo ),
  13.      trapNumber( theTrapNumber ),
  14.      type( theType )
  15.   {
  16.     NSetTrapAddress( const_cast<RoutineDescriptor *>( patch ),
  17.                           trapNumber,
  18.                           type );
  19.   }
  20.  
  21. PatchBase::~PatchBase()
  22.   {
  23.     NSetTrapAddress( old, trapNumber, type );
  24.   }
  25.